//文件上传
var opts = {
    url: "/upload",
    type: "POST",
    beforeSend: function () {
        $("#loading").attr("class", "am-icon-spinner am-icon-pulse");
    },
    success: function (result, status, xhr) {
        if (result.status == "0") {
            alert(result.info);
            $("#loading").attr("class", "am-icon-cloud-upload");
            return false;
        }

        $("input[name='thumb']").val(result.info);
        $("#img_show").attr('src', result.info);

        $("#loading").attr("class", "am-icon-cloud-upload");
    },
    error: function (result, status, errorThrown) {
        $("#loading").attr("class", "am-icon-cloud-upload");
        alert('文件上传失败');
    }
}

//文件上传
var opts_logo = {
    url: "/app_upload",
    type: "POST",
    beforeSend: function () {
        $("#loading").attr("class", "am-icon-spinner am-icon-pulse");
    },
    success: function (result, status, xhr) {
        if (result.status == "0") {
            alert(result.info);
            $("#loading").attr("class", "am-icon-cloud-upload");
            return false;
        }
    
        $("#app_one_show").text(result.info);
        $("input[name='url_aone']").val(result.info);


        $("#loading").attr("class", "am-icon-cloud-upload");
    },
    error: function (result, status, errorThrown) {
        $("#loading").attr("class", "am-icon-cloud-upload");
        alert('文件上传失败');
    }
}

//文件上传
var opts_logo_two = {
    url: "/app_upload",
    type: "POST",
    beforeSend: function () {
        $("#loading").attr("class", "am-icon-spinner am-icon-pulse");
    },
    success: function (result, status, xhr) {
        if (result.status == "0") {
            alert(result.info);
            $("#loading").attr("class", "am-icon-cloud-upload");
            return false;
        }

        $("#app_two_show").text(result.info);
        $("input[name='url_atwo']").val(result.info);


        $("#loading").attr("class", "am-icon-cloud-upload");
    },
    error: function (result, status, errorThrown) {
        $("#loading").attr("class", "am-icon-cloud-upload");
        alert('文件上传失败');
    }
}
//文件上传
var opts_logo_three = {
    url: "/app_upload",
    type: "POST",
    beforeSend: function () {
        $("#loading").attr("class", "am-icon-spinner am-icon-pulse");
    },
    success: function (result, status, xhr) {
        if (result.status == "0") {
            alert(result.info);
            $("#loading").attr("class", "am-icon-cloud-upload");
            return false;
        }

        $("#app_three_show").text(result.info);
        $("input[name='url_athree']").val(result.info);
        
        $("#loading").attr("class", "am-icon-cloud-upload");
    },
    error: function (result, status, errorThrown) {
        $("#loading").attr("class", "am-icon-cloud-upload");
        alert('文件上传失败');
    }
}

$('#thumb_upload').fileUpload(opts);

$('#app_one_upload').fileUpload(opts_logo);

$('#app_two_upload').fileUpload(opts_logo_two);

$('#app_three_upload').fileUpload(opts_logo_three);